package com.example.service;

import com.example.entity.Log;
import com.example.entity.Params;
import com.example.mapper.LogMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class LogService {
    @Autowired
    private LogMapper logMapper;


    public PageInfo<Log> findBySearch(Params params) {
        PageHelper.startPage(params.getPageNum(), params.getPageSize());


        List<Log> list = logMapper.findBySearch(params);
        return PageInfo.of(list);
    }

    public void add(Log log) {
        logMapper.add(log);
    }


    public void delete(Integer id) {

        logMapper.deleteById(id);
    }


}
